mat = dlmread('offset_energy.txt');

sz = size(mat);

n = sqrt(sz(1,1));

cnt = 1;

x = ones(n, n);
y = ones(n, n);
z = ones(n, n);

for i = 1:n
    for j = 1:n
       x(i,j) = mat(cnt, 1);
       y(i,j) = mat(cnt, 2);
       z(i,j) = mat(cnt, 3);
       cnt = cnt + 1;
    end
end

surf(x, y, z);
shading interp;


